USE BolsaTalentos
GO
USE [BolsaTalentos]
GO

/****** Object:  View [dbo].[AplicacionesPorEgresado]    Script Date: 04/21/2009 11:33:53 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[AplicacionesPorEgresado]
AS
SELECT (([t0].[PrimerNombre] + [t0].[SegundoNombre]) + [t0].[PrimerApellido]) + [t0].[SegundoApellido] AS [Nombre], [t1].[Descripcion] AS [Carrera], (
    SELECT COUNT(*)
    FROM [dbo].[Aplicaciones] AS [t2]
    WHERE [t2].[ID_Egresado] = [t0].[ID]
    ) AS [NumeroAplicaciones]
FROM [dbo].[Egresados] AS [t0]
INNER JOIN [dbo].[Carreras] AS [t1] ON [t1].[ID] = [t0].[ID_Carrera]
WHERE [t0].[FechaPrimerIngreso] IS NOT NULL
GO

USE [BolsaTalentos]
GO

/****** Object:  View [dbo].[AplicacionesProVacante]    Script Date: 04/21/2009 11:34:04 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[AplicacionesProVacante]
AS
SELECT [t0].[Descripcion] AS [Vacante], [t1].[Nombre] AS [Publicante], (
    SELECT COUNT(*)
    FROM [dbo].[Aplicaciones] AS [t2]
    WHERE [t2].[ID_Vacante] = [t0].[ID]
    ) AS [NumeroAplicaciones], [t0].[FechaPublicacion], [t0].[FechaCierre] AS [FecahCierre]
FROM [dbo].[Vacantes] AS [t0]
INNER JOIN [dbo].[Empresas] AS [t1] ON [t1].[ID] = [t0].[ID_Empresa]
GO

USE [BolsaTalentos]
GO

/****** Object:  View [dbo].[Fecha]    Script Date: 04/21/2009 11:34:16 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[Fecha]
AS
SELECT DATENAME(DAY, GETDATE()) + '/' + DATENAME(MONTH, GETDATE()) + '/' + DATENAME(YEAR, GETDATE()) as 'Fecha'
GO

USE [BolsaTalentos]
GO

/****** Object:  View [dbo].[UsuariosEmpresaReport]    Script Date: 04/21/2009 11:34:46 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[UsuariosEmpresaReport]
AS
SELECT [t1].[Nombre] AS [Empresa], [t0].[UserName] AS [Usuario], [t0].[FechaPrimerIngreso], [t0].[FechaUltimoIngreso]
FROM [dbo].[UsuariosEmpresa] AS [t0]
INNER JOIN [dbo].[Empresas] AS [t1] ON [t1].[ID] = [t0].[ID_Empresa]
GO

USE [BolsaTalentos]
GO

/****** Object:  View [dbo].[VacantesPorEmpresa]    Script Date: 04/21/2009 11:34:54 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[VacantesPorEmpresa]
AS
SELECT [t0].[Nombre] AS [Empresa], (
    SELECT COUNT(*)
    FROM [dbo].[Vacantes] AS [t1]
    WHERE [t1].[ID_Empresa] = [t0].[ID]
    ) AS [NumeroVacantes], [t0].[FechaSolicitud], [t0].[FechaCreacion] AS [FechaIngreso]
FROM [dbo].[Empresas] AS [t0]
GO

